<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="../statics/css/style.css" />
<!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
<script type="text/javascript"
	src="../statics/js/jquery-1.11.1.min_044d0927.js"></script>
<script type="text/javascript"
	src="../statics/js/jquery.bxslider_e88acd1b.js"></script>

<script type="text/javascript" src="../statics/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../statics/js/menu.js"></script>

<script type="text/javascript" src="../statics/js/select.js"></script>

<script type="text/javascript" src="../statics/js/lrscroll.js"></script>

<script type="text/javascript" src="../statics/js/iban.js"></script>
<script type="text/javascript" src="../statics/js/fban.js"></script>
<script type="text/javascript" src="../statics/js/f_ban.js"></script>
<script type="text/javascript" src="../statics/js/mban.js"></script>
<script type="text/javascript" src="../statics/js/bban.js"></script>
<script type="text/javascript" src="../statics/js/hban.js"></script>
<script type="text/javascript" src="../statics/js/tban.js"></script>

<script type="text/javascript" src="../statics/js/lrscroll_1.js"></script>
<script type="text/javascript">
	function check(){
		var login_username = document.getElementById("uname");
		var login_password = document.getElementById("upwd");
		if(login_username.value == ""){
			alert("用户名不能为空！请重新填入！");
			login_username.focus();		
			return false;
		}else if(login_password.value == ""){
			alert("密码不能为空！请重新填入！");
			login_password.focus();
			return false;
		}
		return true;
	}
	$(function(){
	$("#upwd").attr("disabled", true);
	$("#uphone").blur(function() {
			//1失去焦点，获得表单输入数据
			//var usernameInput = $(username).val();
			var phone = $(this).val();
			var username=$("#uname").val();
			//alert(usernameInput);
			//alert(username);
			//2去服务端校验该用户名是否存在--ajax将用户名提交到服务器校验
			$.ajax({
				url : "UserRegister",
				type : "GET",
				data : {
					"action" : "checkUserName",
					"phone" : phone,
					"username":username
					
				},
				dataType : "json",
				success : function(data) {
					var isExit = data.isExist;
					//3根据返回的isExit动态显示信息
					var usernameInfo = "";
					if (!isExit) {
						//手机号与姓名不符
						usernameInfo = "手机号核验失败，请检查手机号或用户名";
						$("#phoneInfo").css("color", "red");
					} else {
						usernameInfo = "手机号核验成功,请输入新密码";
						$("#upwd").focus();
						$("#upwd").removeAttr("disabled");
						$("#phoneInfo").css("color", "green");
					}
					$("#phoneInfo").html(usernameInfo);
				}
			});
		});
	})
	</script>

<title>二组牛逼</title>
</head>
<body>
	<!--Begin Header Begin-->
	<%@ include file="../common/header.jsp"%>
	<!--End Header End-->
	<!--Begin Login Begin-->
	<div class="log_bg">
		<div class="top">
			<div class="logo">
				<a href="Index.html"><img src="../statics/images/logo.png" /> </a>
			</div>
		</div>
		<div class="login">
			<div class="log_img">
				<img src="../statics/images/l_img.png" width="611" height="425" />
			</div>
			<div class="log_c">
				<form action="UserLogin?opr=updatePwd" method="post"
					onsubmit="return check()">
					<table border="0"
						style="width:370px; font-size:14px; margin-top:30px;"
						cellspacing="0" cellpadding="0">
						<tr height="50" valign="top">
							<td width="55">&nbsp;</td>
							<td><span class="fl" style="font-size:24px;">找回密码</span> <span
								class="fr">想起密码了？<a href="Login.jsp"
									style="color:#ff4e00;">返回登陆</a> </span>
							</td>
						</tr>
						<tr height="70">
							<td>用户名</td>
							<td><input type="text" value="" name="name" class="l_user"
								id="uname" /></td>
						</tr>
						<tr height="70">
							<td>手机号</td>
							<td><input type="text" value="" name="phone" class="l_pwd"
								id="uphone" />
								<div id="phoneInfo"></div>
								</td>
						</tr>
						<tr height="70">
							<td>新密码</td>
							<td><input type="text" value="" name="pwd" class="l_pwd"
								id="upwd" /></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td style="font-size:12px; padding-top:20px;"><span
								style="font-family:'宋体';" class="fl"> <label
									class="r_txt">手机号输入框请输入当前找回密码用户所绑定的手机号</label> </span>
							</td>
						</tr>
						<tr height="60">
							<td>&nbsp;</td>
							<td><input type="submit" value="找回密码" class="log_btn" /></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
	<!--End Login End-->
	<!--Begin Footer Begin-->
	<%@include file="../common/LoginAndReg_Footer.jsp"%>
	<!--End Footer End -->

</body>


<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
